package p270jp.pxv.android.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.fragment.app.BackStackRecord;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import p014ae.AbstractActivityC0111k1;
import p014ae.C0059c5;
import p014ae.C0063d5;
import p045be.IllustNoInfoRecyclerAdapter;
import p062c4.ViewBindings;
import p090d0.C2518n;
import p134ei.AnalyticsScreenName;
import p134ei.PixivAnalytics;
import p270jp.pxv.android.R;
import p307l9.EdgeTreatment;
import p314lg.ActivityLoginOrEnterNickNameBinding;
import p393of.C5453b;
import p402om.WalkThroughIllustService;
import p451qm.ItemDecoration;
import p547uh.LoginOrEnterNickNameFragment;
import p645yc.AndroidSchedulers;
import p671zc.CompositeDisposable;

/* renamed from: jp.pxv.android.activity.LoginOrEnterNickNameActivity */
/* loaded from: classes2.dex */
public class LoginOrEnterNickNameActivity extends AbstractActivityC0111k1 {

    /* renamed from: z */
    public static final /* synthetic */ int f18393z = 0;

    /* renamed from: v */
    public final AnalyticsScreenName f18394v = AnalyticsScreenName.LOGIN;

    /* renamed from: w */
    public CompositeDisposable f18395w = new CompositeDisposable();

    /* renamed from: x */
    public WalkThroughIllustService f18396x;

    /* renamed from: y */
    public ActivityLoginOrEnterNickNameBinding f18397y;

    /* renamed from: S0 */
    public static Intent m4814S0(Context context) {
        EdgeTreatment.m3909i(context);
        Intent intent = new Intent(context, LoginOrEnterNickNameActivity.class);
        intent.putExtra("SHOULD_DISPLAY_RELOGIN_DIALOG", false);
        return intent;
    }

    @Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        View inflate = getLayoutInflater().inflate(R.layout.activity_login_or_enter_nick_name, (ViewGroup) null, false);
        int i = R.id.fragment_container;
        FrameLayout frameLayout = (FrameLayout) ViewBindings.m9835b(inflate, R.id.fragment_container);
        if (frameLayout != null) {
            RecyclerView recyclerView = (RecyclerView) ViewBindings.m9835b(inflate, R.id.recycler_view);
            if (recyclerView != null) {
                FrameLayout frameLayout2 = (FrameLayout) inflate;
                this.f18397y = new ActivityLoginOrEnterNickNameBinding(frameLayout2, frameLayout, recyclerView);
                setContentView(frameLayout2);
                this.f18396x = (WalkThroughIllustService) C2518n.m7641d(WalkThroughIllustService.class);
                ((PixivAnalytics) C2518n.m7641d(PixivAnalytics.class)).m6525e(this.f18394v);
                GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2);
                IllustNoInfoRecyclerAdapter uVar = new IllustNoInfoRecyclerAdapter(this, this.f936e);
                uVar.f4644n = true;
                this.f18397y.f22333c.setLayoutManager(gridLayoutManager);
                this.f18397y.f22333c.m10871g(new ItemDecoration(this, gridLayoutManager));
                this.f18397y.f22333c.setAdapter(uVar);
                this.f18395w.mo82c(this.f18396x.m3213a().m966j(AndroidSchedulers.m334a()).m963m(new C0059c5(this, uVar, 0), C0063d5.f315b));
                boolean booleanExtra = getIntent().getBooleanExtra("SHOULD_DISPLAY_RELOGIN_DIALOG", false);
                BackStackRecord cVar = new BackStackRecord(m11131K0());
                cVar.m11165j(R.id.fragment_container, LoginOrEnterNickNameFragment.m1702g(false, booleanExtra));
                cVar.mo11171d();
                return;
            }
            i = R.id.recycler_view;
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
    }

    @Override // p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        this.f18395w.m80f();
        super.onDestroy();
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        if (z) {
            C5453b.m3260s(this);
        }
    }
}
